"""
@Time    : 2025/7/23 11:35
@Author  : white.tie
@File    : middileware.py
@Desc    : 
"""
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware

app = FastAPI()
# 强制所有传入请求必须是 https 或 wss
app.add_middleware(HTTPSRedirectMiddleware)

@app.get("/")
async def main():
    return {"hello": "world"}

if __name__ == '__main__':
    uvicorn.run(app,host="0.0.0.0",port=8050)